package com.wzq.util;

/**
 * api 返回类
 * 
 *
 * @param <T>
 */
public class ApiResponse<T> {
	private String code;
	private String desc;
	private T data;

	public ApiResponse() {
	}

	public ApiResponse(T data) {
		this(ResponseCode.SUCC);
		this.data = data;
	}

	public ApiResponse(String code, String desc) {
		this.code = code;
		this.desc = desc;
	}

	public ApiResponse(ResponseCode responseCode) {
		this.code = responseCode.getCode();
		this.desc = responseCode.getMessage();
	}

	public void setResponseCode(ResponseCode responseCode) {
		this.code = responseCode.getCode();
		this.desc = responseCode.getMessage();
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getDesc() {
		return desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}

	public T getData() {
		return data;
	}

	public void setData(T data) {
		this.data = data;
	}
}
